<template>
  <div>
    <el-dialog
      :title="title || '上传图片'"
      :visible.sync="visible"
      width="950px"
      :modal="true"
      append-to-body
      custom-class="customDialogUpload"
      :before-close="handleClose"
    >
      <upload-index v-if="visible" :isMore="isMore" :modelName="modelName" @getImage="getImage" />
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'UploadFroms',
  data() {
    return {
      visible: false,
      callback: function() {},
      isMore: '',
      modelName: '',
      title: '',
      ISmodal: false,
    }
  },
  methods: {
    handleClose() {
      this.visible = false
    },
    getImage(img) {
      this.callback(img)
      this.visible = false
    }
  }
}
</script>

<style lang="scss">
  .el-dialog__wrapper {
    .customDialogUpload {
      max-width: 960px !important;
      width: 98% !important;
    }
  }
</style>
